#include <iostream>
#include <algorithm>
#include <string>
#include <cstdio>
#include <vector>
#include <stack>
#include <queue>
#include <set>
using namespace std;
class Solution
{
public:
    vector<vector<int>> ans;
    vector<int> slice;
    void dfs(vector<int> &nums, int cur)
    {
        if (cur > nums.size())
            return;
        ans.push_back(slice);
        for (int i = cur; i < nums.size(); ++i)
        {
            slice.push_back(nums[i]);
            dfs(nums, i + 1);
            slice.pop_back();
        }
    }
    vector<vector<int>> subsets(vector<int> &nums)
    {
        dfs(nums, 0);
        return ans;
    }
};